﻿using UnityEngine;

namespace TC
{
    public class PlayEffect : FunctionNode
    {
        public ValueInput<int> target;
        public ValueInput<string> res;
        public ValueInput<string> node;
        public ValueInput<float> duration;
        public ValueInput<Vector3> position;
        public ValueInput<Vector3> rotation;

        public override void OnCreate()
        {
            base.OnCreate();

            target = this.AddValueInPort<int>("target");
            res = this.AddValueInPort<string>("resource");
            node = this.AddValueInPort<string>("node");
            duration = this.AddValueInPort<float>("duration");
            position = this.AddValueInPort<Vector3>("position");
            rotation = this.AddValueInPort<Vector3>("rotation");
        }

        public override void Execute(Dispatcher chain)
        {
            base.Execute(chain);

            Debug.Log("PlayEffect id: " + target.Value + ", resource: " + res.Value);

            chain.Call(flowOut);
        }
    }
}
